<!--
  Generated template for the WorkerMaterielReturnToPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header no-border>
  <ion-navbar>
    <ion-title>物料退还</ion-title>
  </ion-navbar>
</ion-header>


<ion-content>
  <div class="list_search_header">
    <input placeholder="搜索物料，可模糊搜索" [(ngModel)]="query_field" (keydown)="shuRus($event)" (blur)="sJq()">
    <span (click)="query()">搜索</span>
  </div>
  <ng-container *ngFor="let pro of allPros,index as j;">

    <div class="w12 cart_pro_item pl0 pr0 mb0">
      <div class="cart_pro_info pl10">
        <img class="hide" src="">
        <h3 class="w12 pro_name">{{pro.PRODUCT_NAME}}——{{pro.JQJX_NAME}}</h3>
        <span class="w04 font_gray font_size_msmall">库存：{{pro.PJSL}}</span>
        <span class="w04 font_gray font_size_msmall">单位：{{pro.AMOUNT_UOM_ID}}</span>
        <div class="w12 mt5">
          <div class="w06 pro_pic">
            <span class="fl">￥</span>
            <b class="fl">{{pro.PRICE | money}}</b>
          </div>
          <div class="num_p_m mt5">
            <button class="p" ion-button *ngIf="pro.QUANTITY>0"
                    (click)="quantityChange(pro,0)">-</button>
            <input type="number" readonly [(ngModel)]="pro.QUANTITY" (keydown)="kdqc($event,pro)" (blur)="eqc(pro)">
            <button ion-button (click)="quantityChange(pro,1)">+</button>
          </div>
        </div>
      </div>
    </div>

  </ng-container>

</ion-content>
<ion-footer>
  <div class="cart_footer">
    <div class="fl pl5 pr5" (click)="num>0?isClick = !isClick:''">
      <h3 class="w12">
        <div class="cart_footer_icon"><i class="fa fa-cart-arrow-down"></i><em>{{this.num}}</em></div>
        <span class="fl">合计:</span>
        <div class="footer_pic fl">
          <span class="fl">￥</span>
          <b class="fl">{{ sum | money }}</b>
        </div>
      </h3>
    </div>
    <button class="w04 add_ljgm_btn fr" (click)="onSubmit()">
      <span class="button-inner">确定({{this.num}})</span>
    </button>
  </div>
</ion-footer>

<div class="hbcj_modal" style="top:-50px;" *ngIf="isClick" (click)="isClick = false">
  <div class="cart_main" (click)="$event.stopPropagation()">
    <div class="w12 pl10 pr10 pt5 pb5 bgcolor_gray_444">
      已选物料
      <span class="fr" (click)="clearAll()">
        <i class="fa fa-trash-o mr5"></i>
        清空购物车
      </span>
    </div>
    <ul class="w12 cart_main_list">
      <ng-container *ngFor="let pro of choosePros">
          <ng-container *ngIf="pro.QUANTITY>0">
            <li class="bor_bottom">
              <span class="w06">{{pro.PRODUCT_NAME}}</span>
              <span class="w03 tc">￥{{pro.PRICE | money}}</span>
              <div class="w03">
                <div class="num_p_m">
                  <button class="p" ion-button *ngIf="pro.QUANTITY>0" (click)="quantityChange(pro,0)">-</button>
                  <input type="number" type="number" [value]="pro.QUANTITY" disabled>
                  <button ion-button (click)="quantityChange(pro,1)">+</button>
                </div>
              </div>
            </li>
          </ng-container>
      </ng-container>
    </ul>
  </div>
</div>

